<template>
  <li class="item">
    <div class="card">
      <div class="img-wrapper">
        <img :src="require(`../../assets/img/${item.name}.jpg`)" alt="">
        <div class="mask">
          <h1>{{item.name}}</h1>
          <h2>{{item.festival}}</h2>
        </div>
      </div>
      <div class="content-wrapper">
        <h1>假期描述： {{item.desc || '无说明'}}</h1>
        <h2>拼假建议： {{item.rest || '无拼假'}}</h2>
      </div>
    </div>
  </li>
</template>

<script>
export default {
  props: {
    item: Object
  },
  setup() {
  }
}
</script>

<style lang='less' scoped>
.item{
  // display: block;
  padding: .1rem;
  box-sizing: border-box;
  
  .card{
    border: 1px solid #ddd;
    border-radius: .15rem;
    overflow: hidden;
    background: #fff;
    box-shadow: .01rem .03rem .05rem #999;

    .img-wrapper{
      position: relative;
      height: 2.2rem;

      .mask{ //遮罩层绝对定位
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, .4);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;

        h1{
          font-size: .5rem;
          color: #ed4040;
          font-weight: bold;
          text-shadow: .02 .05 .05 #ddd;
          
        }

        h2{
          font-size: .28rem;
          color: #fff;
          margin-top: .15rem;
        }
      }
    }

    .content-wrapper{
      padding: .1rem;
      box-sizing: border-box;
      
      h1{
        font-size: .16rem;
        line-height: .2rem;
      }

      h2{
        font-size: .14rem;
        margin-top: .1rem;
        line-height: .2rem;
      }
    }
  }
}
</style>